    <div class='fixed hwrap'>
		<a href='javascript:history.back(-1);' target='_parent' class='rel'>
			<i class='icon-angle-left'></i>
		</a>
		<a href='javascript:;' target='_parent'></a>
		<h3 class='dyc'>我的地址</h3>
	</div>
	<div style='height:45px;'></div>
	<div class="aress_list">
	<ul class="wrap" id="wrap">
        <?php foreach($addrlist as $key => $value):?>
		<li data-id='hVE94417916qo'>
		  <div class='w1'> <span class='u_name'><?=$value['address_name']?></span> <span class='u_phone'><?=$value['address_phone']?></span> </div>
		  <div class='w2'><?=$value['province']?>-<?=$value['city']?>-<?=$value['district']?>-<?=$value['address']?></div>
		  <div class='w3 cF'>
            <a href='javascript:;' onclick="defaultAddress('<?=$value['id']?>')" class='fl'>
                  <i class='radius <?php if($value['is_default'] == 1):?>icon-ok-sign<?php endif;?>' data-class='<?=$value['id']?>'></i>设置默认地址
            </a>
			<ul class='s_wrap fr'>
			  <a href='/user/editaddr?id=<?=$value['id']?>'><li> <i class='icon-edit icon-2x'></i>编辑 </li></a>
			  <a href='javascript:;' onclick="javascript:delUserAddress(<?=$value['id']?>);"><li><i class='icon-trash icon-2x'></i>删除 </li></a>
			</ul>
		  </div>
		</li>
        <?php endforeach;?>
	</ul>
</div>
<a href="/user/addaddr" class="sml_btn">
    <div class="mDivButton">新增收货地址</div>
</a>
<script>
//删除地址
function delUserAddress(id){
    layer.confirm("确定要删除该数据？",function(){
        $.post("/user/delUserAddress",{id:id},function(data){
            if(data.code==0){
                layer.msg(data.msg);
                window.location.reload();
            }else{
                layer.msg(data.msg);
            }
        },"json");
    });
}
//修改默认收货地址函数
function defaultAddress(id){
	$.post("/user/defaultaddr",{id:id},function(data){
        if(data.code==0){
            layer.msg(data.msg);
            window.location.reload();
        }else{
            layer.msg(data.msg);
        }
	},"json");
}
</script>
